<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>

 </body>
 <script>
   var random_01 = Math.random();//生成0到1的一个随机数
   console.log("random_01="+random_01);
   //random()生成0到1的一个随机数
   var random_02 = Math.random()*20;
   console.log("random_02="+random_02);
   //向下取整floor(x)
   var floor = Math.floor(random_02);
   console.log("floor="+floor);
   //向上取整ceil(x)
   var ceil = Math.ceil(random_02);
   console.log("ceil="+ceil);
 </script>
</html>
